package com.yorick.authority.modal.request.menu;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yorick.common.util.TrimmerDeserializer;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

@Getter
@Setter
public class MenuAddRequest {
    @JsonProperty("resourceName")
    @NotNull
    @Length(message = "名称不能超过个 {max} 字符", max = 50)
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String resourceName;
    @JsonProperty("resourceDesc")
    @Length(message = "描述不能超过个 {max} 字符", max = 100)
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String resourceDesc;
    @JsonProperty("parentId")
    @NotNull
    private int parentId;
    @JsonProperty("resourceString")
    @Length(message = "菜单路径不能超过个 {max} 字符", max = 100)
    @JsonDeserialize(using = TrimmerDeserializer.class)
    private String resourceString;
    private int aid;
}
